package com.iplant.basic.service.po.mss;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.iplant.base.po.BasePO;
import com.iplant.base.po.enums.DBSchemas;
import com.iplant.base.utils.annotation.join.multi.DBJoinMulti;
import com.iplant.base.utils.annotation.po.DBBasePO;
import com.iplant.base.utils.annotation.condition.DBCondition;
import com.iplant.base.utils.annotation.field.DBField;
import com.iplant.base.utils.annotation.join.DBJoin;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 物料管理
 */
@DBBasePO(TableName = "mss_material", CheckName = {"Code"}, Schemas = DBSchemas.Basic,Cache = true)
public class MSSMaterial extends BasePO implements Serializable {

    private static final long serialVersionUID = 1L;

    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBField
    public String OldMaterialNo = "";

    /**
     * 全称
     */
    @DBField
    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    public String MaterialName = "";
    // 常用计量单位ID
    @DBField
    public int CYUnitID = 0;

    // 常用计量单位文本
    @DBJoin(name = "Name", tableName = "mss_unit", tableAsName = "t1", Schemas = DBSchemas.Basic,
            MainTableField = "CYUnitID")
    public String CYUnitText = "";

    /**
     * 预留区别ID
     */
    @DBCondition
    @DBField
    public int TypeID = 0;

    /**
     * 简称
     */
    @DBField
    public String AbbrName = "";

    /**
     * 精度 默认2 即保留两位小数
     */
    @DBField
    public int Accuracy = 2;

    /**
     * 助记码
     */
    @DBField
    public String MnemonicCode = "";

    /**
     * 批准文号
     */
    @DBField
    public String ApprovalNumber = "";

    /**
     * 是否反冲料 1是 0 否
     */
    @DBCondition
    @DBField
    public int Recoil = 0;

    /**
     * 最小包装
     */
    @DBField
    public double MinPacking = 0;

    /**
     * 整套标识
     */
    @DBField
    public String Matching = "";

    /**
     * 长度
     */
    @DBField
    public double Length = 0;

    /**
     * 宽度
     */
    @DBField
    public double Width = 0;

    /**
     * 高度
     */
    @DBField
    public double Height = 0;

    /**
     * 体积
     */
    @DBField
    public double Volume = 0;

    /**
     * 是否外协 1 是 0不是
     */
    @DBCondition
    @DBField
    public int Outsourced = 0;

    /**
     * 物料类型
     */
    @DBCondition
    @DBField
    public int MaterialTypeID = 0;
    @DBJoin(name = "Code", tableName = "mss_materialtype", tableAsName = "t2", Schemas = DBSchemas.Basic,
            MainTableField = "MaterialTypeID")
    public String MaterialTypeCode = "";
    @DBJoin(name = "Name", tableName = "mss_materialtype", tableAsName = "t2", Schemas = DBSchemas.Basic,
            MainTableField = "MaterialTypeID")
    public String MaterialTypeName = "";

    /**
     * 物料类型信息文本
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBField
    public String MaterialMode = "";

    /**
     * 物料组
     */
    @DBCondition
    @DBField
    public int MaterialGroupID = 0;

    /**
     * 物料组编号
     */
    @DBJoin(name = "Code", tableName = "mss_materialgroup", tableAsName = "t3", Schemas = DBSchemas.Basic,
            MainTableField = "MaterialGroupID")
    public String MaterialGroupCode = "";
    /**
     * 物料组名称
     */
    @DBJoin(name = "Name", tableName = "mss_materialgroup", tableAsName = "t3", Schemas = DBSchemas.Basic,
            MainTableField = "MaterialGroupID")
    public String MaterialGroupName = "";

    @DBCondition(CompareType = DBCondition.DBCompareType.leftLike)
    @DBJoin(name = "FullGroupName", tableName = "mss_materialgroup", tableAsName = "t3", Schemas = DBSchemas.Basic,
            MainTableField = "MaterialGroupID")
    public String MaterialFullGroup = "";
    /**
     * 大小量纲 规格型号
     */
    @DBField
    public String Groes = "";

    /**
     * 工业标准
     */
    @DBField
    public String Normt = "";

    /**
     * 净重
     */
    @DBField
    public double NetWeight = 0.0;

    /**
     * 毛重
     */
    @DBField
    public double GrossWeight = 0.0;

    /**
     * 重量单位
     */
    @DBField
    public int ZLUnitID = 0;

    /**
     * 重量单位文本
     */
    @DBJoin(name = "Name", tableName = "mss_unit", tableAsName = "t4", Schemas = DBSchemas.Basic,
            MainTableField = "CYUnitID")
    public String ZLUnitText = "";

    /**
     * 默认安全库存
     */
    @DBField
    public double SafeFQTY = 0;

    /**
     * 保质期  <=0 不过期
     */
    @DBField
    public int SafeDate = 0;

    /**
     * 默认库位容量
     */
    @DBField
    public double DefaultStock = 0;

    /**
     * 图号
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBField
    public String DrawingNo = "";

    /**
     * 品牌/制造商
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBField
    public String Manufacturer = "";

    /**
     * 单价
     */
    @DBField
    public float UnitPrice = 0.0f;

    /**
     * 供应商
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBField
    public String Supplier = "";

    /**
     * 存放位置
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBField
    public String Position = "";

    /**
     * 归属产品型号（编码）
     */
    @DBCondition
    @DBField
    public String ProductNo = "";

    /**
     * 工序文件ID集合
     */
    @DBField
    public List<Integer> FileIDList = new ArrayList<>();

    /**
     * 检验文件模板
     */
    @DBJoinMulti(Name = "FileUrl", MainTableField = "FileIDList", TableName = "sfc_file", Schemas = DBSchemas.MES
    )
    public String CheckFile = "";

    /**
     * 图纸文件ID
     */
    @DBField
    public List<Integer> DrawingFileIDList = new ArrayList<>();

    /**
     * 图纸文件路径
     */
    @DBJoinMulti(Name = "FileUrl", MainTableField = "DrawingFileIDList", TableName = "sfc_file", Schemas = DBSchemas.MES
    )
    public String DrawingFileUrls = "";

    @JsonProperty("OldMaterialNo")
    public String getOldMaterialNo() {
        return OldMaterialNo;
    }

    public void setOldMaterialNo(String oldMaterialNo) {
        OldMaterialNo = oldMaterialNo;
    }

    @JsonProperty("CYUnitID")
    public int getCYUnitID() {
        return CYUnitID;
    }

    public void setCYUnitID(int cYUnitID) {
        CYUnitID = cYUnitID;
    }

    @JsonProperty("CYUnitText")
    public String getCYUnitText() {
        return CYUnitText;
    }

    public void setCYUnitText(String cYUnitText) {
        CYUnitText = cYUnitText;
    }

    @JsonProperty("TypeID")
    public int getTypeID() {
        return TypeID;
    }

    public void setTypeID(int typeID) {
        TypeID = typeID;
    }

    @JsonProperty("MaterialTypeID")
    public int getMaterialTypeID() {
        return MaterialTypeID;
    }

    public void setMaterialTypeID(int materialTypeID) {
        MaterialTypeID = materialTypeID;
    }

    @JsonProperty("MaterialTypeCode")
    public String getMaterialTypeCode() {
        return MaterialTypeCode;
    }

    public void setMaterialTypeCode(String materialTypeCode) {
        MaterialTypeCode = materialTypeCode;
    }

    @JsonProperty("MaterialTypeName")
    public String getMaterialTypeName() {
        return MaterialTypeName;
    }

    public void setMaterialTypeName(String materialTypeName) {
        MaterialTypeName = materialTypeName;
    }

    @JsonProperty("MaterialMode")
    public String getMaterialMode() {
        return MaterialMode;
    }

    public void setMaterialMode(String materialMode) {
        MaterialMode = materialMode;
    }

    @JsonProperty("MaterialGroupID")
    public int getMaterialGroupID() {
        return MaterialGroupID;
    }

    public void setMaterialGroupID(int materialGroupID) {
        MaterialGroupID = materialGroupID;
    }

    @JsonProperty("MaterialGroupCode")
    public String getMaterialGroupCode() {
        return MaterialGroupCode;
    }

    public void setMaterialGroupCode(String materialGroupCode) {
        MaterialGroupCode = materialGroupCode;
    }

    @JsonProperty("MaterialGroupName")
    public String getMaterialGroupName() {
        return MaterialGroupName;
    }

    public void setMaterialGroupName(String materialGroupName) {
        MaterialGroupName = materialGroupName;
    }

    @JsonProperty("Groes")
    public String getGroes() {
        return Groes;
    }

    public void setGroes(String groes) {
        Groes = groes;
    }

    @JsonProperty("Normt")
    public String getNormt() {
        return Normt;
    }

    public void setNormt(String normt) {
        Normt = normt;
    }

    @JsonProperty("NetWeight")
    public double getNetWeight() {
        return NetWeight;
    }

    public void setNetWeight(double netWeight) {
        NetWeight = netWeight;
    }

    @JsonProperty("GrossWeight")
    public double getGrossWeight() {
        return GrossWeight;
    }

    public void setGrossWeight(double grossWeight) {
        GrossWeight = grossWeight;
    }

    @JsonProperty("ZLUnitID")
    public int getZLUnitID() {
        return ZLUnitID;
    }

    public void setZLUnitID(int zLUnitID) {
        ZLUnitID = zLUnitID;
    }

    @JsonProperty("ZLUnitText")
    public String getZLUnitText() {
        return ZLUnitText;
    }

    public void setZLUnitText(String zLUnitText) {
        ZLUnitText = zLUnitText;
    }

    @JsonProperty("MaterialName")
    public String getMaterialName() {
        return MaterialName;
    }

    public void setMaterialName(String materialName) {
        MaterialName = materialName;
    }

    @JsonProperty("SafeFQTY")
    public double getSafeFQTY() {
        return SafeFQTY;
    }

    public void setSafeFQTY(double safeFQTY) {
        SafeFQTY = safeFQTY;
    }

    @JsonProperty("SafeDate")
    public int getSafeDate() {
        return SafeDate;
    }

    public void setSafeDate(int safeDate) {
        SafeDate = safeDate;
    }


    @JsonProperty("DrawingNo")
    public String getDrawingNo() {
        return DrawingNo;
    }

    public void setDrawingNo(String drawingNo) {
        DrawingNo = drawingNo;
    }

    @JsonProperty("AbbrName")
    public String getAbbrName() {
        return AbbrName;
    }

    public void setAbbrName(String abbrName) {
        AbbrName = abbrName;
    }

    @JsonProperty("Accuracy")
    public int getAccuracy() {
        return Accuracy;
    }

    public void setAccuracy(int accuracy) {
        Accuracy = accuracy;
    }

    @JsonProperty("MnemonicCode")
    public String getMnemonicCode() {
        return MnemonicCode;
    }

    public void setMnemonicCode(String mnemonicCode) {
        MnemonicCode = mnemonicCode;
    }

    @JsonProperty("ApprovalNumber")
    public String getApprovalNumber() {
        return ApprovalNumber;
    }

    public void setApprovalNumber(String approvalNumber) {
        ApprovalNumber = approvalNumber;
    }

    @JsonProperty("Recoil")
    public int getRecoil() {
        return Recoil;
    }

    public void setRecoil(int recoil) {
        Recoil = recoil;
    }

    @JsonProperty("MinPacking")
    public double getMinPacking() {
        return MinPacking;
    }

    public void setMinPacking(double minPacking) {
        MinPacking = minPacking;
    }

    @JsonProperty("Matching")
    public String getMatching() {
        return Matching;
    }

    public void setMatching(String matching) {
        Matching = matching;
    }

    @JsonProperty("Length")
    public double getLength() {
        return Length;
    }

    public void setLength(double length) {
        Length = length;
    }

    @JsonProperty("Width")
    public double getWidth() {
        return Width;
    }

    public void setWidth(double width) {
        Width = width;
    }

    @JsonProperty("Height")
    public double getHeight() {
        return Height;
    }

    public void setHeight(double height) {
        Height = height;
    }

    @JsonProperty("Volume")
    public double getVolume() {
        return Volume;
    }

    public void setVolume(double volume) {
        Volume = volume;
    }

    @JsonProperty("Outsourced")
    public int getOutsourced() {
        return Outsourced;
    }

    public void setOutsourced(int outsourced) {
        Outsourced = outsourced;
    }

    @JsonProperty("DefaultStock")
    public double getDefaultStock() {
        return DefaultStock;
    }

    public void setDefaultStock(double defaultStock) {
        DefaultStock = defaultStock;
    }

    @JsonProperty("MaterialFullGroup")
    public String getMaterialFullGroup() {
        return MaterialFullGroup;
    }

    public void setMaterialFullGroup(String materialFullGroup) {
        MaterialFullGroup = materialFullGroup;
    }

    @JsonProperty("Manufacturer")
    public String getManufacturer() {
        return Manufacturer;
    }

    public void setManufacturer(String manufacturer) {
        Manufacturer = manufacturer;
    }

    @JsonProperty("UnitPrice")
    public float getUnitPrice() {
        return UnitPrice;
    }

    public void setUnitPrice(float unitPrice) {
        UnitPrice = unitPrice;
    }

    @JsonProperty("Supplier")
    public String getSupplier() {
        return Supplier;
    }

    public void setSupplier(String supplier) {
        Supplier = supplier;
    }

    @JsonProperty("Position")
    public String getPosition() {
        return Position;
    }

    public void setPosition(String position) {
        Position = position;
    }

    @JsonProperty("ProductNo")
    public String getProductNo() {
        return ProductNo;
    }

    public void setProductNo(String productNo) {
        ProductNo = productNo;
    }

    @JsonProperty("CheckFile")

    public String getCheckFile() {
        return CheckFile;
    }

    public void setCheckFile(String checkFile) {
        CheckFile = checkFile;
    }

    @JsonProperty("FileIDList")
    public List<Integer> getFileIDList() {
        return FileIDList;
    }

    public void setFileIDList(List<Integer> fileIDList) {
        FileIDList = fileIDList;
    }

    @JsonProperty("DrawingFileIDList")
    public List<Integer> getDrawingFileIDList() {
        return DrawingFileIDList;
    }

    public void setDrawingFileIDList(List<Integer> drawingFileIDList) {
        DrawingFileIDList = drawingFileIDList;
    }

    @JsonProperty("DrawingFileUrls")
    public String getDrawingFileUrls() {
        return DrawingFileUrls;
    }

    public void setDrawingFileUrls(String drawingFileUrls) {
        DrawingFileUrls = drawingFileUrls;
    }
}
